import { request } from "./request";
// 添加购物车
export function addCar(data){
    return request({
        url:'/api/carts',
        method:'post',
        data
    })
}
// 修改购物车，data={num:1}
// modify:修改
export function modifyCar(id,data){
    return request({
        url:`/api/carts/${id}`,
        // patch:补丁
        method:'put',
        data
    })
}
export function checkedCar(data){
    return request({
        url:'/api/carts/checked',
        method:'patch',
        data
    })
}
// 获取购物车
export function getCar(data=''){
    return request({
        url:'/api/carts?'+data,
    } )
}
// 删除购物车
export function deleteCarItem(id){
    return request({
        url:`/api/carts${id}`,
        method:'delete'

    })
}

